<?php
defined('BY_JYA') or exit('error');
/*
	每日入账、出金、余额数据
	参考源文件：\Application\Auction\Controller\OtherController.class.php
	问题：暂未找到相应数据表
*/
 //日入金总额/充值
$data['pay']=pdo_fetchcolumn('select sum(money) from '.tablename('jy_jdpm_money_log').' where type=0 and create_time between '.strtotime(date('Y-m-d')).' and '.strtotime(date('Y-m-d 23:59:59')).'');
//日出金总额/提现
$data['out']=pdo_fetchcolumn('select sum(money) from '.tablename('jy_jdpm_member_pledge_take').' where dtime between '.strtotime(date('Y-m-d')).' and '.strtotime(date('Y-m-d 23:59:59')).'');
//平台余额总额/总额
$data['total']=pdo_fetchcolumn('select sum(wallet_pledge) from '.tablename('jy_jdpm_member'));
//平台冻结总额/冻结
$data['pledge']=pdo_fetchcolumn('select sum(wallet_pledge_freeze) from '.tablename('jy_jdpm_member'));
$time=date('Y-m-d');
$check=pdo_getcolumn('jy_jdpm_payout',array('createtime'=>$time),'id');
if($check){
	pdo_update('jy_jdpm_payout',$data,array('id'=>$check));
}else{
	pdo_insert('jy_jdpm_payout',$data);
}
return true;